![]() |
![]() |
The CIFrame component allows you to manipulate frames and their content.
Frames are a new feature in PageMaker 6.5. Refer to the PageMaker User Guide for more information about how frames work.
Many CIFrame interfaces require a PMOBJ_REC pointer. Refer to the CIObjectAccess component for information about how to create and work with PMOBJ_REC objects.
PMBool
IsAFrame(PMOBJ_REC*
pPMRec);
Use this to validate that a returned PMOBJ_REC really is a frame before calling other CIFrame routines.
Turns a PageMaker graphic into a frame, or a frame into a PageMaker graphic. The shape of the object is not affected. Turns a box, oval or polygon into a frame, or a frame into a box, oval or polygon.
PMErr
CreateFrame(RECT*
prBound, WORD wShape, PMOBJ_REC *pFrameID = NULL);
Creates a frame within the area prBound. The frame's object record is returned in pFrameID, and the shape of the frame is set by wShape. The wShape parameter should be: Box, Oval, or RegularPolygon.
The bounds of the new frame are expressed in twips and relative to PageMakers origin point. (For information on working with the PageMaker coordinate system, see the topic on coordinates.)
If you want to get the object record for the newly created frame, pass a PMOBJ_REC structure in pFrameID. See CIObjectAccess for information on Object Records.
PMErr
NewText(PMOBJ_REC* pPMRec);
Place text insertion point inside a frame
PMErr
InsertText(PMOBJ_REC*
pPMRec, LPSTR pStr);
Inserts the text pStr into the frame object pPMRec.
PMErr
GetContentType(PMOBJ_REC*
pFrameID, BYTE* pType);
Get the content type of frames. Returns constants TypeEmpty, TypeText or TypePicture.
PMBool
EmptyFrame(PMOBJ_REC*
pFrameID);
Checks the frame pFrameID, and returns true if there is no content.
PMBool
FullFrame(PMOBJ_REC*
pFrameID);
Checks the frame pFrameID, and returns true if it has content.
PMErr
GetAspect(PMOBJ_REC*
pFrameID, PMBool* pbAspect);
Retrieves the "maintain aspect ratio" attribute for the frame pFrameID. The value pbAspect will return TRUE if the frame is set to maintain its aspect ratio.
PMErr
SetAspect(PMOBJ_REC*
pFrameID, PMBool bAspect);
Changes the "maintain aspect ratio" attribute for the frame pFrameID. Pass TRUE in pbAspect if the frame should maintain its aspect ratio.
PMErr
GetHorzAlign(PMOBJ_REC*
pFrameID, BYTE* pAlign);
PMErr SetHorzAlign(PMOBJ_REC* pFrameID,
BYTE align);
Retrieves or changes the horizontal alignment attribute for the frame pFrameID. The frame must be a TypePicture frame.
The valid alignment settings are AlignHorzLeft, AlignHorzCenter, AlignHorzRight, and AlignHorzCustom.
PMErr
GetVertAlign(PMOBJ_REC*
pFrameID, BYTE* pAlign);
PMErr SetVertAlign(PMOBJ_REC* pFrameID,
BYTE align);
Retrieves the vertical alignment attribute for the frame pFrameID. The frame must be a TypePicture frame.
The valid alignment settings are AlignVertTop, AlignVertCenter, AlignVertBottom, and AlignVertCustom.
PMErr
GetScaleType(PMOBJ_REC*
pFrameID, BYTE* pScaleType);
PMErr SetScaleType(PMOBJ_REC* pFrameID,
BYTE scaleType);
Retrieve or change the picture scale attribute for the picture frame pFrameID. The scale attribute determines how a picture that is larger than the frame would be fit to the frame. The constants for the possible attributes are Clip_To_Fit, Size_To_Fit, and Scale_To_Fit.
PMErr
GetMargin(PMOBJ_REC*
pFrameID, RECT* prMargin);
PMErr SetMargin(PMOBJ_REC* pFrameID,
RECT* prMargin);
Gets or sets the margins for the text frame pFrameID using the values inprMargin. Measaurements are in twips.
PMErr
GetContent(PMOBJ_REC*
pContID, PMOBJ_REC* pFrameID);
Gets the object record for the content of the frame specified in pFrameID. The content object record is returned in pContID.
PMErr
AttachContent(PMOBJ_REC*
pFrameID = NULL, PMOBJ_REC* pContID = NULL);
Attaches the object, pContID, to the frame pFrameID.
NOTE: The objectID for text content objects will not be valid after this method is called. The content object should be manipulated by its object record. Use GetContent() to get the object record of the frames content. Graphic content will retain its object ID, but the object ID is not validfor commands and queries while the graphic is attached to a frame.
Breaks the text flow links to a frame.
PMErr
DeleteContent(PMOBJ_REC*
pFrameID = NULL);
Deletes the content from the frame pFrameID. This method works for both picture and text content.
PMErr
SeparateContent(PMOBJ_REC*
pFrameID = NULL);
Separates the content from the frame, pFrameID, and makes it an independent object.
NOTE: Separated text content will not have the same object ID as it did before it was attached to the frame. Graphic content retains its object ID. See AttachContent.
PMErr
MoveContent(PMOBJ_REC*
pFrameID, POINT ptOffset);
Moves the content within the frame pFrameID, by the distance ptOffset. The x and y values in pOffset are used by the MoveContent method as distances in twips, with positive values moving the content toward the bottom and right of the frame, and negative values moving the content toward the top and left.
To move the frame itself, use the MoveFrame interface.
PMErr
ScaleContent(PMOBJ_REC*
pFrameID, PMBool bAspect);
Scales the content of the frame pFrameID according to the current scale type. If bAspect is true, then the picture will keep its aspect ratio, if it is false, the picture may be scaled by different amounts on its vertical and horizontal axis.
PMErr
MoveFrame(PMOBJ_REC*
pFrameID, POINT ptOffset);
Moves the frame pFrameID, by the distance ptOffset. The x and y values in pOffset are used by the MoveContent method as distances in twips, with positive values moving the content toward the bottom and right of the frame, and negative values moving the content toward the top and left.
To move the contents within the frame, use the MoveContent interface.
PMErr
ResizeFrame(PMOBJ_REC*
pFrameID, RECT* pRect);
Resizes the frame pFrameID according to the values in pRect. The values for left, top, right, and bottom are in twips.
PMErr
GetLinkFrame(PMOBJ_REC*
pFrameID, PMOBJ_REC* pLinkID, PMBool bUpStream);
Returns the object record for the frame linked to the frame specified in pFrameID. If the value in bUpStream is true, then the method will return the previous frame in the chain, if it is false, the next frame is returned. The object record for the linked frame is returned in pLinkID.
PMErr
SetLinkFrame(PMOBJ_REC*
pFrameID, PMOBJ_REC* pLinkID, PMBool bUpStream);
Links pFrameID to pLinkID. If the value in pUpStream is true, then pLinkID will be linked to the top of pFrameID, and text will flow from pLinkID to pFrameID. If pUpStream is false, then pLinkID will link to the bottom handle of pFrameID, and text will flow from pFrameID to pLinkID.
PMErr
BreakFrameLinks(PMOBJ_REC*
pFrameID = NULL);
Breaks the text flow links to the frame identified by pFrameID. Both the previous and next frames are dettached from the frame specified.
If the frame is in a chain, this has the affect of splitting the chain where the frame was located in that chain.
Comments or suggestions? Contact Adobe Developer Support